<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Route::prefix('wzm')->group(function (){
    //搜索医生接口
    Route::get('search_doctor',['App\Http\Controllers\api\doctor\DoctorController','searchDoctor'])->name('search_doctor');
    //添加医生接口
    Route::post('create_doctor',['App\Http\Controllers\api\doctor\DoctorController','createDoctor'])->name('create_doctor');
    //添加患者照片接口
    Route::any('create_sick_img',['App\Http\Controllers\api\sick\SickController','createSickImg'])->name('create_sick_img');
    //添加患者接口
    Route::post('create_sick',['App\Http\Controllers\api\sick\SickController','createSick'])->name('create_sick');
    //添加身份证接口
    Route::any('create_id_card_image',['App\Http\Controllers\api\sick\SickController','createIdCardImage'])->name('create_id_card_image');
    //添加身份证
    Route::post('create_id_card',['App\Http\Controllers\api\sick\SickController','createIdCard'])->name('create_id_card');
    //获取access_token
    Route::get('get_access_token',['App\Logic\IdCardImageVerify','getAccessToken'])->name('get_access_token');
    //获取图片base64编码
    Route::post('get_file_content_as_base64',['App\Logic\IdCardImageVerify','getFileContentAsBase64'])->name('get_file_content_as_base64');
    //验证图片是否为身份证照片
    Route::post('is_id_card_image',['App\Logic\IdCardImageVerify','run'])->name('is_id_card_image');
    //入院信息详情
    Route::get('live_in_index',['App\Http\Controllers\api\LiveIn\LiveInController','LiveInIndex'])->name('live_in_index');
    //展示抽奖商品
    Route::get('gift_index',['App\Http\Controllers\api\gift\GiftController','giftIndex'])->name('gift_index');
    //积分抽奖
    Route::get('score_raffle',['App\Http\Controllers\api\gift\GiftController','scoreRaffle'])->name('score_raffle')
        ->middleware('count');
    //免费抽奖
    Route::get('free_raffle',['App\Http\Controllers\api\gift\GiftController','freeRaffle'])->name('free_raffle')
        ->middleware('count_day');
    //兑换商品列表
    Route::get('ex_change_index',['App\Http\Controllers\api\exchange\ExChangeController','exChangeIndex'])->name('ex_change_index');
    //兑换商品
    Route::get('ex_changing',['App\Http\Controllers\api\exchange\ExChangeController','exChanging'])->name('ex_changing');
    //mongoDB存储聊天消息
    Route::get('mongo',['App\Http\Controllers\api\customer\CustomerController','mongo'])->name('mongo');
    //存储图片信息到七牛云
    Route::post('customer_img',['App\Http\Controllers\api\customer\CustomerController','customerImg'])->name('customer_img');
    //mongoDB存储图片信息
    Route::get('mongo_img',['App\Http\Controllers\api\customer\CustomerController','mongoImg'])->name('mongo_img');
    //执行签到
    Route::get('create_sign',['App\Http\Controllers\admin\sign\SignController','createSign'])->name('create_sign');
    //执行补签
    Route::get('repair_sign',['App\Http\Controllers\admin\sign\SignController','repairSign'])->name('repair_sign');
});
